package com.smartrm.trade.adapter.repository.impl;


import com.smartrm.globalinfrcore.event.DomainEventBus;
import com.smartrm.trade.domain.OrderDO;
import com.smartrm.trade.domain.SlotVendingMachineDO;
import com.smartrm.trade.domain.SlotVendingMachineState;
import com.smartrm.trade.domain.repository.VendingMachineRepository;
import com.smartrm.trade.infrasturcture.dataobject.TradeSlotVendingMachinePO;
import com.smartrm.trade.infrasturcture.mapper.TradeSlotVendingMachineMapper;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.stereotype.Repository;

/*
 * @program: common-starters
 * @description: 货道售卖机交易资源库
 * @author: houhong
 * @create: 2023-01-10 15:57
 */
@Qualifier("tradeVendingMachineRepository")
@Repository
public class TradeVendingMachineRepository implements VendingMachineRepository {

    private static final Logger logger = LoggerFactory
            .getLogger(TradeVendingMachineRepository.class);

    @Autowired
    private TradeSlotVendingMachineMapper slotVendingMachineMapper;
    @Autowired
    private DomainEventBus domainEventBus;

    /*
     * 生成聚合
     */
    @Override
    public SlotVendingMachineDO getSlotVendingMachineById(long id) {

        TradeSlotVendingMachinePO slotVendingMachinePO = slotVendingMachineMapper.selectOne(id);
        OrderDO orderDO = null;
        if (SlotVendingMachineState.Ready.code() != slotVendingMachinePO.getState()) {

        }
        //// TODO: 2023/1/10  
        return null;
    }


}